package com.lqian.demo03.singleton.doublecheck;
public class LazyDoubleCheckSingleTon {
    private volatile static LazyDoubleCheckSingleTon lazy = null;

    private LazyDoubleCheckSingleTon(){};

    public static LazyDoubleCheckSingleTon getInstance(){
        if (lazy == null){
            synchronized (LazyDoubleCheckSingleTon.class){
                if (lazy == null){
                   return lazy = new LazyDoubleCheckSingleTon();
                }
            }
        }
        return lazy;
    }



}

class User{
    private int age;

    public static void main(String[] args) {
        User user = new User();
        System.out.println(user.hashCode());
    }
}
